import request from "@/utils/request";

// 查询内容管理列表
export function listArticle(query) {
  return request({
    url: "/system/article/list",
    method: "get",
    params: query,
  });
}

// 查询内容管理详细
export function getArticle(id) {
  return request({
    url: "/system/article/" + id,
    method: "get",
  });
}

// 新增内容管理
export function addArticle(data) {
  return request({
    url: "/system/article",
    method: "post",
    data: data,
  });
}

// 修改内容管理
export function updateArticle(data) {
  return request({
    url: "/system/article",
    method: "put",
    data: data,
  });
}

// 删除内容管理
export function delArticle(id) {
  return request({
    url: "/system/article/" + id,
    method: "delete",
  });
}

// 获取类型树结构数据
export function getTreeList(data) {
  return request({
    url: "/system/dict/data/tree?dictType=sys_article_type",
    method: "get",
    data,
  });
}

// 发布文章
export function toReleased(data) {
  return request({
    url: "/system/article/publicArticle",
    method: "post",
    data,
  });
}
// 发布文章
export function toRevoked(data) {
  return request({
    url: "/system/article/recallArticle",
    method: "post",
    data,
  });
}
